package com.fate.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fate.system.entity.Tenant;
import com.fate.system.service.ITenantService;
import com.fate.system.mapper.TenantMapper;
import org.springframework.stereotype.Service;
import com.fate.framework.utils.SystemUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fate.system.dto.tenant.TenantPageDTO;

/**
 * @author 47349
 * @description 针对表【sys_tenant(租户表)】的数据库操作Service实现
 * @createDate 2024-08-07 01:38:10
 */
@Service
public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> implements ITenantService {

  public Page<Tenant> getPageList(TenantPageDTO pageDTO) {
    Page<Tenant> page = SystemUtil.buildPageFromDTO(pageDTO, Tenant.class);
    return this.lambdaQuery().orderByDesc(Tenant::getGmtCreate).page(page);
  }
}
